package sctu.edu.java.year2016.team07.liaohengju.day20160524.chapter6_3;

import java.util.Scanner;

/**
 * Created by hengju on 2016/5/24.
 * 3、在项目中创建DateAndTime类，将今天的全部信息格式化后输出，再将日期以“年-月-日”的格式输出。
 */
import java.util.Date;
import java.util.Locale;

public class DateAndTime {
    public static void main(String[] args) {
        Date today = new Date();
        String b = String.format(Locale.US, "%tB", today);
        String d = String.format("%tA", today);
        String e = String.format("%tY", today);
        String g = String.format("%tm", today);
        String h = String.format("%td", today);
        System.out.println("本月是：" + b);
        System.out.println("今天是：" + d);
        System.out.println("今年是：" + e+"年");
        System.out.println("本月是：" + g+"月");
        System.out.println("今天是：" + h+"日");
        System.out.println("今天是：" + e + "-" + g + "-" + h);
    }
}
